package com.csy.feign.user.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.csy.commons.core.page.PageResult;
import com.csy.commons.dto.SysRole;
import com.csy.commons.dto.SysUser;
import com.csy.commons.vo.AjOwnerVo;
import com.csy.feign.user.fallback.UserServiceApiFallbackFactory;

@FeignClient(name = "csy-user", // (1) 目标微服务的application-name
		path = "/csy-user", // (2) 目标的请求地址URI
		fallbackFactory = UserServiceApiFallbackFactory.class) // (3) 这个类是指定调用出错时微服务降级处理的类
public interface UserServiceApi {
	/**
	 * 查询角色列表
	 * 
	 * @param role
	 * @return
	 */
	@RequestMapping("/system/role/list")
	public PageResult list(SysRole role);

	/**
	 * 查询用户
	 * 
	 * @param nickName
	 * @return
	 */
	@RequestMapping("/system/user/getByName")
	public SysUser getByName(@RequestParam("nickName") String nickName);

	/**
	 * 查询用户列表
	 * 
	 * @param user
	 * @return
	 */
	@GetMapping("/system/user/list")
	public PageResult list(SysUser user);

	/**
	 * 查询用户
	 * 
	 * @param username
	 * @return
	 */
	@GetMapping("/system/user/getByUsername")
	public SysUser getByUsername(@RequestParam("username") String username);

	/**
	 * 查询业主列表
	 * 
	 * @param ajOwnerVo
	 * @return
	 */
	@GetMapping("/system/owner/list")
	public PageResult list(AjOwnerVo ajOwnerVo);

	/**
	 * 查询业主
	 * 
	 * @param ownerRealName
	 * @return
	 */
	@GetMapping("/system/owner/getByName")
	public AjOwnerVo getOwnerByName(@RequestParam("ownerRealName") String ownerRealName);
}
